package com.stormrage.entity.exam.rep;

import java.io.Serializable;

import com.stormrage.entity.exam.ExmAnswer;

/**
 * @Title: ExmAnswerRep.java
 * @Package com.stormrage.entity.exam.rep
 * @Description: 考试答案返回类
 * @author www.stormragetech.com
 * @date 2016年4月26日
 * @version V1.0
 */
public class ExmAnswerRep implements Serializable {

	// ------------------------------- Fields -------------------------------

	private static final long serialVersionUID = -4792985435649180490L;

	// ------------------------------- Fields -------------------------------

	private Integer seq;

	private Integer id;

	private String answer;

	private Integer examId;

	private String correct;

	// ------------------------------- Fields -------------------------------

	public ExmAnswerRep() {
	}

	// ------------------------------- Fields -------------------------------

	public Integer getSeq() {
		return seq;
	}

	public void setSeq(Integer seq) {
		this.seq = seq;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getAnswer() {
		return answer;
	}

	public void setAnswer(String answer) {
		this.answer = answer;
	}

	public Integer getExamId() {
		return examId;
	}

	public void setExamId(Integer examId) {
		this.examId = examId;
	}

	public String getCorrect() {
		return correct;
	}

	public void setCorrect(String correct) {
		this.correct = correct;
	}

	// ------------------------------- Fields -------------------------------

	public static ExmAnswerRep instance(ExmAnswer arg0, Integer seq) {
		ExmAnswerRep entity = new ExmAnswerRep();
		entity.setSeq(seq);
		entity.setId(arg0.getId());
		entity.setAnswer(arg0.getAnswer());
		entity.setExamId(arg0.getExamId());
		if (arg0.getCorrect().equals(0))
			entity.setCorrect("正确");
		if (arg0.getCorrect().equals(1))
			entity.setCorrect("错误");
		return entity;
	}

	@Override
	public String toString() {
		return this.getClass() + " : id - " + id + " seq - " + seq + " answer - " + answer + " examId - " + examId
				+ " correct - " + correct;
	}

}
